<?php
	include_once('_lib/class.app.php');
	include_once('_lib/class.dpf.php');
	include_once('_lib/class.cardinfo.php');
	include_once('_lib/class.cardlist.php');
	include_once('_lib/class.server.php');

	$action = $_POST['action'];

	if(!$_COOKIE["warabi_admin"]){
		echo "deny";
		exit;
	}
	switch($action){
		case "adduser":
			$appuser -> insert_OneUser($_POST["username"] , $_POST["userpwd"] , $_POST["userauth"] , $_POST["usernick"]);
			break;
		case "moduser":
			$appuser -> update_OneUser($_POST["userid"] , $_POST["language"] , $_POST["password"]);
			break;
		case "deluser":
			$appuser -> delete_OneUser($_POST["userid"]);
			break;
		case "moddpfuser":
			$dpfuser -> update_OneUser($_POST["userid"] , $_POST["defh"] , $_POST["defw"] , $_POST["defq"]);
			break;
		case "deldpfuser":
			$dpfuser -> delete_OneUser($_POST["userid"]);
			break;
		case "delcardinfo":
			$cardinfo ->update_OneCard($_POST["cardinfoid"]);
			break;
		case "modconfig":
			$config -> update_OneConfig($_POST["cid"] , $_POST["value"]);
			break;
		case "delcardlist":
			$cardlist->update_OneCard($_POST["cardlistid"]);
			break;
	}
?>